import datetime

date1 = datetime.datetime(2024, 1,26)
date2 = datetime.datetime.now()
print(date2 - date1)

# 翻转字符串
# def reverseWords(s):
#     tokens = s.split()
#     print( tokens)
#     tokens.reverse()
#     return " ".join(tokens)
#
# print(reverseWords('i am a student.'))

# 统计是给定字符串前缀的字符串数目
# def countPrefixes(words, s):
#     res = 0 # 符合要求字符串个数
#     for word in words:
#         if s.startswith(word):
#             res += 1
#     return res
# print(countPrefixes(["a","b","c","ab","bc","abc"], "abc"))


# 文件查找工具
import os
"""
inputPath = input("请输入代搜索路径：")
pattern = input("请输入待检索的关键字：")

for dirpath, dirnames, filenames in os.walk(inputPath):
    for f in filenames:
        if pattern in f:
            print(f'{dirpath}/{f}')
"""
import qrcode

# img = qrcode.make("我是大王")
# img.save('qrcode.png')


"""
操作Excel文件
"""
import xlrd

# # 打开xlsx文件
# xlsx = xlrd.open_workbook('D://TEST/test1.xlsx')
# # 获取第一个sheet
# sheet = xlsx.sheet_by_index(0)
# # 获取总行号
# nrows = sheet.nrows
# # 遍历数据
# count = 0
# total = 0
# for i in range(1, nrows):
#     classId = sheet.cell_value(i, 1)
#     if classId == 101:
#         total += sheet.cell_value(i, 2)
#         count += 1
# print(f'101的总成绩是：{total}, 平均分是：{total/count}')

# 程序员鼓励师

